// Widgets/Home/CommonHead/CommonHead.js
//获取应用实例
const app = getApp()
const assetsAddress = app.globalData.global.assetsIp + '/' + app.globalData.global.assetsName;
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    activeIndex: {
      type: Number,
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    assetsAddress: assetsAddress,
    CustomBar: wx.getSystemInfoSync().statusBarHeight,
    soltMarginRight: app.globalData.soltMarginRight,
    tabList: [
      { id: 0, name: '机票套餐', icon: assetsAddress + '/common/jpIcon.png'},
      { id: 1, name: '酒店套餐', icon: assetsAddress + '/common/jdIcon.png'},
      { id: 2, name: '豪车租赁', icon: assetsAddress + '/common/zchIcon.png'},
      { id: 3, name: '游艇租赁', icon: assetsAddress + '/common/ytIcon.png'},
      { id: 4, name: '运动娱乐', icon: assetsAddress + '/common/ydIcon.png'},
    ],
  },

  /**
   * 组件的方法列表
   */
  methods: {
    tabChange(e){
      let item = e.target.dataset.item||e.currentTarget.dataset.item;
      this.triggerEvent('tabChange', item.id)
    },
    // 跳转搜索页面
    goSearch(){
      wx.navigateTo({
        url: '/pages/Home/travelSearch/travelSearch',
      })
    },
  }
})